package com.lyt.springboot.util.algorithm;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class Test {
    public static void main(String[] args) {
        //list去重
        List<String> list = new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("e");
        list.add("b");
        list.add("b");
        list.add("a");
        System.out.println(Test.quchong(list));
    }

    public static List<String> quchong(List<String> list) {
        BlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<>();
        BlockingQueue<Runnable> workQueue1 = new LinkedBlockingQueue<>(100);
        List<String> list1 = new ArrayList<>();
        for (String qu : list) {
            if (!list1.contains(qu)) {
                list1.add(qu);
            }
        }
        return list1;

    }
}
